import http from '../http/http.js';
import qs from "qs";

export default {
    getInvoiceTitleList() {
        return http({
            method: "get",
            url: "/api/user/invoice/title",
        }).catch((e) => {
            return e;
        });
    },
    addInvoiceTitle(data) {
        return http({
            method: "post",
            data: data,
            url: "/api/user/invoice/title",
        }).catch((e) => {
            return e;
        });
    },
    editInvoiceTitle(data) {
        return http({
            method: "put",
            data: data,
            url: "/api/user/invoice/title",
        }).catch((e) => {
            return e;
        });
    },
    delInvoiceTitle(id) {
        return http({
            method: "DELETE",
            url: "/api/user/invoice/title/" + id,
        }).catch((e) => {
            return e;
        });
    },
    notapplyList() {
        return http({
            method: "get",
            url: "/api/order/invoice/notapply",
        }).catch((e) => {
            return e;
        });
    },
    applyingList() {
        return http({
            method: "get",
            url: "/api/order/invoice/applying",
        }).catch((e) => {
            return e;
        });
    },
    appliedList() {
        return http({
            method: "get",
            url: "/api/order/invoice/applied",
        }).catch((e) => {
            return e;
        });
    },
    applyInvoice(data) {
        return http({
            method: "post",
            data: data,
            url: "/api/order/invoice",
        }).catch((e) => {
            return e;
        });
    },
    delApplyInvoice(orderNo) {
        return http({
            method: "DELETE",
            url: "/api/order/invoice/" + orderNo,
        }).catch((e) => {
            return e;
        });
    },
    applyingDetail(id) {
        return http({
            method: "get",
            url: "/api/order/invoice/applying/" + id,
        }).catch((e) => {
            return e;
        });
    },
    appliedDetail(id) {
        return http({
            method: "get",
            url: "/api/order/invoice/applied/" + id,
        }).catch((e) => {
            return e;
        });
    }
};
